package Coding.IO;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Copy2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("./demo.txt");  //读
        FileOutputStream fileOutputStream = new FileOutputStream("./demo2.txt"); //写


        byte[] data = new byte[1024*10];
        int len;
        long start = System.currentTimeMillis();
        while(  ( len=fileInputStream.read(data)) !=1){
            fileOutputStream.write(data,0,len);
        }
        long end = System.currentTimeMillis();


    }
}
